﻿<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <!-- jsp文件头和头部 -->
    <%@ include file="../admin/top.jsp" %>
</head>
<body>

<div class="container-fluid" id="main-container">
    <div id="page-content" class="clearfix">
        <div class="row-fluid">
            <div class="row-fluid">
                <!-- 检索  -->
                <form action="app/list.do" method="post" name="appForm" id="appForm">
                    <!-- 检索  -->
                    <table id="table_report" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>平台ID</th>
                            <th>平台名称</th>
                            <th>SERVER_IP</th>
                            <th>SERVER_PORT</th>
                            <th>SERVER_CLIENT_ID</th>
                            <th>SERVER_PASSWORD</th>
                            <th>CLIENT_SRC_ID</th>
                            <th>CLIENT_SECRET</th>
                            <th>CLIENT_SERVICE_ID</th>
                            <th>cmebAppId</th>
                            <th>cmebPasswd</th>
                            <th>cmebIp</th>
                            <th>cmebPort</th>
                            <th>cmebVersion</th>
                        </tr>
                        </thead>

                        <tbody>
                        <!-- 开始循环 -->
                        <c:choose>
                            <c:when test="${not empty appList}">
                                <%--<c:if test="${QX.cha == 1 }">--%>
                                <c:forEach items="${appList}" var="app" varStatus="vs">
                                    <tr>
                                        <td class='center' style="width: 30px;">${vs.index+1}</td>
                                        <td>${app.appId }</td>
                                        <td><a>${app.appName }</a></td>
                                        <td>${app.serverIp }</td>
                                        <td>${app.serverPort }</td>
                                        <td>${app.serverClientId }</td>
                                        <td>${app.serverPassword }</td>
                                        <td>${app.clientSrcId }</td>
                                        <td>${app.clientSecret }</td>
                                        <td>${app.clientServiceId }</td>
                                        <td>${app.cmebAppId}</td>
                                        <td>${app.cmebPasswd }</td>
                                        <td>${app.cmebIp }</td>
                                        <td>${app.cmebPort }</td>
                                        <td>${app.cmebVersion }</td>
                                        <!--
                                        <td style="width: 60px;">
                                            <div class='hidden-phone visible-desktop btn-group'>
                                                <c:if test="${QX.edit == 1 }">
                                                    <a class='btn btn-mini btn-info' title="编辑"
                                                       onclick="editApp('${app.appId }');"><i class='icon-edit'></i></a>
                                                </c:if>
                                                <c:if test="${QX.del == 1 }">
                                                    <a class='btn btn-mini btn-danger' title="删除"
                                                       onclick="delApp('${app.appId }','${app.appName }');"><i
                                                            class='icon-trash'></i></a>
                                                </c:if>
                                            </div>
                                        </td>
                                        -->
                                    </tr>

                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <tr class="main_info">
                                    <td colspan="15" class="center">没有相关数据</td>
                                </tr>
                            </c:otherwise>

                        </c:choose>

                        </tbody>
                    </table>

                    <div class="page-header position-relative">
                        <table style="width:100%;">
                            <tr>
                                <td style="vertical-align:top;">
                                    <c:if test="${QX.add == 1 }">
                                        <a class="btn btn-small btn-success" onclick="add();">新增</a>
                                    </c:if>
                                </td>
                                <td style="vertical-align:top;">
                                    <div class="pagination"
                                         style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </form>
            </div>

            <!-- PAGE CONTENT ENDS HERE -->
        </div><!--/row-->

    </div><!--/#page-content-->
</div><!--/.fluid-container#main-container-->

<!-- 返回顶部  -->
<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
    <i class="icon-double-angle-up icon-only"></i>
</a>

<!-- 引入 -->
<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/ace-elements.min.js"></script>
<script src="static/js/ace.min.js"></script>

<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
<script type="text/javascript" src="static/js/bootbox.min.js"></script><!-- 确认窗口 -->
<!-- 引入 -->

<script type="text/javascript" src="static/js/jquery.tips.js"></script><!--提示框-->
<script type="text/javascript">

    $(top.hangge());

    //新增
    function add() {
        top.jzts();
        var diag = new top.Dialog();
        diag.Drag = true;
        diag.Title = "新增";
        diag.URL = '<%=basePath%>app/goAddApp.do';
        diag.Width = 325;
        diag.Height = 415;
        diag.CancelEvent = function () { //关闭事件
            if (diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none') {
                if ('${page.currentPage}' == '0') {
                    top.jzts();
                    setTimeout("self.location=self.location", 100);
                } else {
                    nextPage(${page.currentPage});
                }
            }
            diag.close();
        };
        diag.show();
    }

    //修改
    function editApp(app_id) {
        top.jzts();
        var diag = new top.Dialog();
        diag.Drag = true;
        diag.Title = "资料";
        diag.URL = '<%=basePath%>app/goEditApp.do?APP_ID=' + app_id;
        diag.Width = 325;
        diag.Height = 815;
        diag.CancelEvent = function () { //关闭事件
            if (diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none') {
                nextPage(${page.currentPage});
            }
            diag.close();
        };
        diag.show();
    }

    //删除
    function delApp(appId, msg) {
        bootbox.confirm("确定要删除[" + msg + "]吗?", function (result) {
            if (result) {
                top.jzts();
                var url = "<%=basePath%>app/deleteApp.do?APP_ID=" + appId + "&tm=" + new Date().getTime();
                $.get(url, function (data) {
                    nextPage(${page.currentPage});
                });
            }
        });
    }

</script>

<script type="text/javascript">

    $(function () {

        //日期框
        $('.date-picker').datepicker();

        //下拉框
        $(".chzn-select").chosen();
        $(".chzn-select-deselect").chosen({allow_single_deselect: true});


    });

</script>
</body>
</html>

